package br.sddp.modelo;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;

@Entity
@NamedQueries({
	@NamedQuery(name="Respostas.FindAll", query="SELECT r FROM Resposta r"),
})

public class Resposta implements Serializable{

	private static final long serialVersionUID = 6519537690163816516L;

	@Id @GeneratedValue
	private Integer id;
	
	@Lob
	private String resposta;
	
	@OneToOne
	private Usuario respondeu;
	
	private Long idDuvida;
	
	/*METODOS CONSTRUTORES*/
	public Resposta(){}
	
	public Resposta(Integer id, String resposta, Usuario usuario) {
		super();
		this.id = id;
		this.resposta = resposta;		
	}
		
	/*METODOS MODIFICADORES*/
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getResposta() {
		return resposta;
	}
	public void setResposta(String resposta) {
		this.resposta = resposta;
	}
	public Long getIdDuvida() {
		return idDuvida;
	}
	public void setIdDuvida(Long idDuvida) {
		this.idDuvida = idDuvida;
	}

	public Usuario getRespondeu() {
		return respondeu;
	}

	public void setRespondeu(Usuario respondeu) {
		this.respondeu = respondeu;
	}	
}
